<div class="page-content" >
	<div class="panel panel-default">
		<div class="panel-heading">
		<ul class="breadcrumb">
                    <li><a href="<{:addons_url('index')}>">素材管理</a> </li>
                      <li><a href="<{:addons_url('feedslist',array('keyName'=>$feeds_data['keyName']))}>"><{$feeds_data.name}></a></li>
                    <li class="active"><if condition="$data.id eq ''">添加图文<else />修改图文</if></li>
                </ul>
		</div>
		<div class="panel-body">
			 <form enctype="multipart/form-data"  class="form-horizontal" action="<{:addons_url('feedsInsert')}>" method="post" id="myform">
            	  <input type="hidden"  name="id" value="<{$data.id}>">
                  <input type="hidden"  name="keyName" value="<{$_GET['keyName']}>">
    
                        <div class="form-group">
                            <label for="input-title" class="col-sm-2 control-label">标题</label>
                            <div class="col-sm-7">
                                <input type="text" class="form-control" id="title" name="title" value="<{$data.title}>">
       
                            </div>
                        </div>
                    	
						            <div class="form-group">
                            <label for="input-title" class="col-sm-2 control-label">链接地址</label>
                            <div class="col-sm-7">
                                <input type="text" class="form-control" id="url" name="url" value="<{$data.url}>">
       
                            </div>
                        </div>
    

                        <div class="form-group">
                            <label for="input-title" class="col-sm-2 control-label">简介</label>
                            <div class="col-sm-7">
                                <textarea name="tip" class="form-control"  id="tip"><{$data.tip}></textarea>   
                            </div>
                        </div>
                         <div class="form-group">
                                <label for="input-title" class="col-sm-2 control-label">图片</label>
                                <div class="col-sm-7">
                                    <div id="preview"></div>
                                    <input type="file" id="img" name="img" onchange="previewImage(this)"  />
                                    <if condition="$data['id']">
                                    	<img src="__Img__<{$data.img}>" width="50" style="display: inline;" />
                                    	<input type="hidden" name="oldimg" value="<{$data.img}>" />
                                    </if>
                            
                                </div>
                            </div>


                       
                         <div class="form-group">
					<div class="col-sm-offset-2 col-sm-7">
						<button type="submit" class="btn btn-primary">保存</button>
					</div>
				</div>
                        
                      
               
                </form>
		</div>
	</div>
</div>

<script>
 
$(function(){
    $(".form-horizontal").bootstrapValidator({
        message: '您填入的值不合法',
        fields:{
            title: {
                message: '标题名称',
                validators: {
                    notEmpty: {
                        message: '标题名称不能为空'
                    },
                }
            },
			url: {
                message: '链接地址',
                validators: {
                    notEmpty: {
                        message: '链接地址不能为空'
                    },
                }
            },
			tip: {
                message: '简介地址',
                validators: {
                    notEmpty: {
                        message: '简介不能为空'
                    },
                }
            },
			 
			  

        }
    });
	
 
});
 </script>



 